package com.zff.rental.mapstruct.apartment;


import com.zff.rental.entity.apartment.ApartmentEntity;
import com.zff.rental.mapstruct.BaseMapstruct;
import com.zff.rental.po.apartment.RecommendApartmentPo;
import com.zff.rental.vo.apartment.apartment.AddApartmentParams;
import com.zff.rental.vo.apartment.apartment.ApartmentVo;
import com.zff.rental.vo.apartment.apartment.ModifyApartmentParams;
import com.zff.rental.vo.apartment.apartment.RecommendApartmentVo;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author HCY
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ApartmentMapstruct extends BaseMapstruct {
    ApartmentMapstruct INSTANCE = Mappers.getMapper(ApartmentMapstruct.class);

    ApartmentVo map(ApartmentEntity findResult);

    ApartmentEntity map(AddApartmentParams params);

    @Mapping(target = "id", ignore = true)
    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    void merge(@MappingTarget ApartmentEntity target, ModifyApartmentParams source);

    List<ApartmentVo> mapAsList(List<ApartmentEntity> records);

    List<RecommendApartmentVo> mapToRecommendApartmentVoList(List<ApartmentEntity> records);

    RecommendApartmentVo mapToRecommendApartment(RecommendApartmentPo recommendApartmentPo);
}
